import 'package:flutter/material.dart';
import 'package:hyouka_assistant/android_webview.dart';
import 'package:hyouka_assistant/hyouka_assistant.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('AI Assistant'),
        ),
        body: Center(
          child: Column(
            children: [
              ElevatedButton(
                onPressed: () {
                  hyoukaAssistant.openAssistantSheet("http://172.16.130.108:3002/");
                },
                child: Text("Open Assistant"),
              ),
              ElevatedButton(
                onPressed: () {
                  hyoukaAssistant.openUrl("http://172.16.130.108:3002/#/settings", {'id': 123});
                },
                child: Text("Open Settings"),
              ),
              Expanded(child: AndroidWebView(url: "https://www.baidu.com/")),
            ],
          ),
        ),
      ),
    );
  }
}
